<?php
	$file 	=	$_REQUEST["file"];
	define('DS', DIRECTORY_SEPARATOR);
	define('PATH_ROOT', dirname(__FILE__) . DS);
	$file = PATH_ROOT.'..'.DS.'..'.DS.'..'.DS.'cache'.DS.'jacompress'.DS.$file;
	
	if($_REQUEST['type'] == "css"){
		header('Content-type: text/css; charset: UTF-8');
		header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 1728000) . ' GMT');	
		header("Content-Encoding: gzip");		
	}else{
		header('Content-type: text/javascript; charset: UTF-8');
		header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 1728000) . ' GMT');		
		header('Cache-control: max-age=30');	
		header("Content-Encoding: gzip");
	}
	
	if(file_exists($file)){   
	   header('Last-Modified: '.gmdate('D, d M Y H:i:s',filemtime($file)).' GMT');
	   $content = file_get_contents($file);
	   echo($content);
	}
?>